package model

import "fmt"

func init() {
	Register(&Exchange{})
}

// Exchange 兑换码
type Exchange struct {
	OID    string `bson:"_id" json:"_id,omitempty"`
	Uid    string `bson:"uid" json:"uid,omitempty"  `
	Code   string `bson:"iid" json:"id"`
	Update int64  `json:"update" bson:"update"`
}

func NewExchange(uid string, code string) *Exchange {
	r := &Exchange{Uid: uid, Code: code}
	r.OID = fmt.Sprintf("%s-%s", uid, code)
	return r
}
